package com.erp.remote.information;

import com.erp.entity.information.Account;
import com.erp.util.AjaxResult;
import com.erp.util.AmountDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@RequestMapping("/information/account")
public interface AccountRemote {
    @RequestMapping("/selectAllAccount")
    AjaxResult selectAllAccount();


    @RequestMapping("/selectAccountByCompanyId")
    AjaxResult selectAccountByCompanyId(@RequestParam("companyId") Integer companyId);

    /**
     * 启用账户
     * @param params
     * @return
     */
    @PostMapping("/enableAccount")
    AjaxResult enableAccount(@RequestBody Map<String,Object> params);

    /**
     * 禁用账户
     * @param params
     * @return
     */
    @PostMapping("/disableAccount")
    AjaxResult disableAccount(@RequestBody Map<String,Object> params);


    /**
     * 添加账户
     * @param account
     * @return
     */
    @PostMapping("/addAccount")
    AjaxResult addAccount(@RequestBody Account account);


    /**
     * 用于在新增时，根据accountCode验证客户是否唯一
     * @param accountCode
     * @return
     */
    @RequestMapping("/checkAccountOnly")
    AjaxResult checkAccountOnly(@RequestParam("accountCode") String accountCode);




    @RequestMapping("/updateAccount")
    AjaxResult updateAccount(@RequestBody Account account);

    /**
     * 批量修改账户金额
     * @param list
     * @return
     */
    @PostMapping("/batchUpdateBalance")
    AjaxResult batchUpdateBalance(@RequestBody List<AmountDTO> list);


}
